package cn.good.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 日期转换工具
 */
public class DateUtils {
    public static Date stringToDate(String format,String date){
        SimpleDateFormat sdf = new SimpleDateFormat(format);

        try {
            return sdf.parse(date);
        } catch (ParseException e) {
            e.printStackTrace();
            System.out.println("日期转换错误！");
        }
        return null;
    }
}
